package com.smartstate.IOC.controller;

import com.smartstate.IOC.service.CarbonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/Emissions")
@Api(tags = {"园区碳排放总量"})
public class CarbonController {

    @Resource
    private CarbonService carbonService;


    @GetMapping("/total")
    @ApiOperation(value = "园区碳排放总量")
    public Integer carbonTotal(){
        return carbonService.getCarbonTotal();
    }

    @GetMapping("/emissionsTotal")
    @ApiOperation(value = "工业生产过程碳排放量")
    public Map<String ,Integer> emissionsTotal(){
        return carbonService.getEmissionsTotal();
    }

    /**
     * 当前月份的前六个月碳排放总量
     */
    @GetMapping("/mouthSix")
    @ApiOperation(value = "当前月份的前六个月碳排放总量")
    public List<Map<String, Integer>> getSixMouthEmissions(){
        return carbonService.getMouthSix();
    }
}
